{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    }
   ],
   "source": [
    "%pylab inline\n",
    "import matplotlib.pyplot as plt\n",
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import numpy.random as rng\n",
    "import pandas.io.data as web\n",
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "def get_prices(symbol):\n",
    "    start, end = '2007-05-02', '2016-04-11'\n",
    "    data = web.DataReader(symbol, 'yahoo', start, end)\n",
    "    data=pd.DataFrame(data)\n",
    "    prices=data['Adj Close']\n",
    "    prices=prices.astype(float)\n",
    "    return prices\n",
    "\n",
    "def get_returns(prices):\n",
    "        return ((prices-prices.shift(-1))/prices)[:-1]\n",
    "    \n",
    "def get_data(list):\n",
    "    l = []\n",
    "    for symbol in list:\n",
    "        rets = get_returns(get_prices(symbol))\n",
    "        l.append(rets)\n",
    "    return np.array(l).T\n",
    "\n",
    "def sort_data(rets):\n",
    "    ins = []\n",
    "    outs = []\n",
    "    for i in range(len(rets)-100):\n",
    "        ins.append(rets[i:i+100].tolist())\n",
    "        outs.append(rets[i+100])\n",
    "    return np.array(ins), np.array(outs)\n",
    "        \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "symbol_list = ['C', 'GS']\n",
    "rets = get_data(symbol_list)\n",
    "ins, outs = sort_data(rets)\n",
    "ins = ins.transpose([0,2,1]).reshape([-1, len(symbol_list) * 100])\n",
    "div = int(.8 * ins.shape[0])\n",
    "train_ins, train_outs = ins[:div], outs[:div]\n",
    "test_ins, test_outs = ins[div:], outs[div:]\n",
    "\n",
    "#normalize inputs\n",
    "train_ins, test_ins = train_ins/np.std(ins), test_ins/np.std(ins)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "sess = tf.InteractiveSession()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "positions = tf.constant([-1,0,1]) \n",
    "num_positions = 3\n",
    "\n",
    "x = tf.placeholder(tf.float32, [None, len(symbol_list) * 100])\n",
    "y_ = tf.placeholder(tf.float32, [None,  len(symbol_list)])\n",
    "\n",
    "W = tf.Variable(tf.random_normal([len(symbol_list) * 100, num_positions * len(symbol_list)]))\n",
    "b = tf.Variable(tf.random_normal([num_positions * len(symbol_list)]))\n",
    "\n",
    "y = tf.matmul(x, W) + b \n",
    "\n",
    "\n",
    "# loop through symbol, taking the columns for each symbol's bucket together\n",
    "pos = {}\n",
    "symbol_returns = {}\n",
    "relevant_target_column = {}\n",
    "for i in range(len(symbol_list)):\n",
    "    # isolate the buckets relevant to the symbol and get a softmax as well\n",
    "    symbol_probs = y[:,i*num_positions:(i+1)*num_positions]\n",
    "    symbol_probs_softmax = tf.nn.softmax(symbol_probs) # softmax[i, j] = exp(logits[i, j]) / sum(exp(logits[i]))\n",
    "    # sample probability to chose our policy's action\n",
    "    sample = tf.multinomial(tf.log(symbol_probs_softmax), 1)#sample = tf.argmax(symbol_probs_softmax, 1) #use a real sample\n",
    "    pos[i] = tf.reshape(sample, [-1]) - 1   # choose(-1,0,1)\n",
    "    # get returns by multiplying the policy (position taken) by the target return for that day\n",
    "    symbol_returns[i] = tf.mul(tf.cast(pos[i], float32),  y_[:,i])\n",
    "    # isolate the probability of the selected policy (for use in calculating gradient)\n",
    "    sample_mask = tf.reshape(tf.one_hot(sample, 3), [-1,3])\n",
    "    relevant_target_column[i] = tf.reduce_sum(symbol_probs_softmax * sample_mask,1) # should be relevant to SAMPLE\n",
    "    \n",
    "# calculate the PERFORMANCE METRICS for the data chosen\n",
    "daily_returns_by_symbol = tf.concat(1, [tf.reshape(t, [-1,1]) for t in symbol_returns.values()])\n",
    "daily_returns = tf.reduce_sum(daily_returns_by_symbol,1)/2\n",
    "total_return = tf.reduce_prod(daily_returns + 1)\n",
    "ann_vol = tf.mul(\n",
    "    tf.sqrt(tf.reduce_mean(tf.pow((daily_returns - tf.reduce_mean(daily_returns)),2))) ,\n",
    "    np.sqrt(252)\n",
    "    )\n",
    "sharpe = total_return / ann_vol\n",
    "\n",
    "# CROSS ENTROPY\n",
    "training_target_cols = tf.concat(1, [tf.reshape(t, [-1,1]) for t in relevant_target_column.values()])\n",
    "ones = tf.ones_like(training_target_cols)\n",
    "gradient = tf.nn.sigmoid_cross_entropy_with_logits(training_target_cols, ones)\n",
    "\n",
    "# COST\n",
    "# how should we do this step? it depends how we want to group our results. Choose your own adventure here by uncommenting a cost fn\n",
    "# this is the most obvious: we push each weight to what works or not. Try it out...we're gonna be RICH!!!! oh, wait...\n",
    "#cost = tf.mul(gradient , daily_returns_by_symbol)\n",
    "# this takes the overall daily return and pushes the weights so that the overall day wins. Again, it overfits enormously\n",
    "#cost = tf.mul(gradient , tf.reshape(daily_returns,[-1,1]))\n",
    "# this multiplies every gradient by the overall return. If the strategy won for the past ten years, we do more of it and vice versa\n",
    "cost = tf.mul(gradient , total_return)\n",
    "costfn = tf.reduce_mean(cost)\n",
    "\n",
    "optimizer = tf.train.GradientDescentOptimizer(0.005).minimize(cost)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch: 5000 cost= 0.173014879 total return= -0.486480296\n",
      "Epoch: 10000 cost= 0.256526262 total return= -0.228146195\n",
      "Epoch: 15000 cost= 0.159734488 total return= -0.520039856\n",
      "Epoch: 20000 cost= 0.200976387 total return= -0.391009867\n"
     ]
    }
   ],
   "source": [
    "# initialize variables to random values\n",
    "init = tf.initialize_all_variables()\n",
    "sess.run(init)\n",
    "# run optimizer on entire training data set many times\n",
    "train_size = train_ins.shape[0]\n",
    "for epoch in range(20000):\n",
    "    start = rng.randint(train_size-50)\n",
    "    batch_size = rng.randint(2,20)\n",
    "    end = min(train_size, start+batch_size)\n",
    "    \n",
    "    sess.run(optimizer, feed_dict={x: train_ins[start:end], y_: train_outs[start:end]})#.reshape(1,-1).T})\n",
    "    # every 1000 iterations record progress\n",
    "    if (epoch+1)%5000== 0:\n",
    "        c,t = sess.run([costfn, total_return], feed_dict={x: train_ins, y_: train_outs})#.reshape(1,-1).T})\n",
    "        print(\"Epoch:\", '%04d' % (epoch+1), \"cost=\", \"{:.9f}\".format(c), \"total return=\", \"{:.9f}\".format(t-1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# in sample results\n",
    "d, t = sess.run([daily_returns, gradient], feed_dict={x: train_ins, y_: train_outs})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1128746d8>]"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEACAYAAABS29YJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXeYVdXVxt81jTID0rsIGrAQQdSIYGFE+AQsxEjkw/gp\nlkh8xBpLNAlCjC3GWBNbxGDX2E0URWXsXTpSbFTBgvRhYGb298e623PumVtnzr3n3Hvf3/PMs0+b\nc9Zt71ln7bXXFmMMCCGE5DdFQRtACCEk81DsCSGkAKDYE0JIAUCxJ4SQAoBiTwghBQDFnhBCCoCE\nYi8iu4rILBFZKCILROS8OMfdKiLLRGSuiAzMjKmEEEIaS0mS/TsBXGiMmSMiFQA+FpG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Oy5pNsezy7IvVQRvEezURwNTIcl8AK0Jg0ycAhkaWjwTwod82+S4aMV7UKGgmzGcALs/09VzX\nPRQaF58DYHbkbySAdgBeAbAUwMsA2rj+54qInYsR6RnPoH1D4WTjBG4TVFw/BDAX6vXsErRd0E69\nhQDmQ8W+NNs2QZ/A1gDYAe1/Oq0xNgA4IPI6PgNwq882nQ5gGYDlru/6P7Jpk8euGvteefZ/gYjY\nB/Be/WhT5Hv0QOQaHwOoDPjzOw36JPs+VK/eBTDQb5s4qIoQQgoATktICCEFAMWeEEIKAIo9IYQU\nABR7QggpACj2hBBSAFDsCSGkAKDYE0JIAUCxJ4SQAuD/ASnwnZeJlW6lAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1125581d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# equity curve\n",
    "plot(np.cumprod(d+1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "#out of sample results\n",
    "d, t = sess.run([daily_returns, gradient], feed_dict={x: test_ins, y_: test_outs})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1133145c0>]"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAEACAYAAABbMHZzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XeYlOXV+PHvYWGFXToLCy5VRJplUUQkimsHjWKM/ojd\naCyJvIpGJRiNS6K+ajSxRSWvJXaMHQuCimsXRWlKke7CwsJSpCPI/fvjzDizs9N2dvqcz3VxzcxT\nZs4+Mee5n7uKcw5jjDG5pVGqAzDGGJN8lvyNMSYHWfI3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dug2+dGPA17uSjpYDFeLrtJiGmTn7vrwaeTWZMaCnoSeCfAdtTdq3CxJTqa1UEtPa8\nbwZ8iA66TOW1ChVTx1ReK7/fPgp4PdX/TYWJKW7/TSUk2Hr8UcPRnhGLgLEpiqGH56LNBL7xxgG0\nBd4FvgOmeP+DTWAcz6EjoX9E20J+Gy4G4AbPdZsPnJikmC7yJLnZwCzgVbReNJkxHYHWgc4EZnj+\nDUvltQoR0/A0uFYHAF974poNXBfpv+0kXKtQMaX0Wvn91lH4etak9P9/fr9V5hfTU/G6TjbIyxhj\ncpAt42iMMTnIkr8xxuQgS/7GGJODLPkbY0wOsuRvjDE5yJK/McbkIEv+xhiTgyz5G2NMDvr/2rm/\nXRLQHssAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1125b5470>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#out of sample results\n",
    "plot(np.cumprod(d+1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
